package com.spancer.contentcenter.controller;

import com.spancer.contentcenter.domain.entity.result.ResultData;
import com.spancer.contentcenter.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * author by: mars
 * Date: 2020/8/9 11:22
 * Description:
 */
@CrossOrigin
@RestController
@RequestMapping("/api/v1/topics")
public class TopicController {

    @Autowired
    private TopicService topicService;

    @GetMapping("/list")
    public ResultData getTopicInfoByPageAndCategory(
            @RequestParam("page") Integer page
            ,@RequestParam("category") String category){
         return ResultData.resultOkWithPage(
                 topicService.getTopicInfoByPageAndCategory(page,category),page,10,500);
    }
}
